#!/usr/bin/perl -w # for syntax highlighting
use gri_secmgr qw(get_user_name);
# CSS-V1

sub mm_admin_portal_options {
my ($portal,$repname,$repnum)=@_;

	my $user_name=get_user_name();
	my ($portal_admin,$err)=$::GRI_FRONTEND->does_user_have_role($user_name,"portal_admin");

	#################################################################
	# If the user is not in the "portal_admin" then we don't create	#
	# any links...							#
	#################################################################
	if($portal_admin==0) {
		return "
    <tr class=gri_row>
      <td colspan=2 class=gri_cell-disabled>&nbsp; &nbsp; Add New Portal</td>
    </tr>
    <tr class=gri_row>
      <td colspan=2 class=gri_cell-disabled>&nbsp; &nbsp; Delete Existing Portal</font></td>
    </tr>
    <tr class=gri_row>
      <td colspan=2 class=gri_cell-disabled>&nbsp; &nbsp; Modify Existing Portal</font></td>
    </tr>
    <tr class=gri_row>
      <td colspan=2 class=gri_cell-disabled>&nbsp; &nbsp; Modify Subscribed Reports</font></td>
    </tr>";
	}

	#################################################################
	# We now need to generate links to the admin pages ...		#
	#################################################################
	my $s="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Add New Portal","form_add_portal","");
	$s.="
      </td>
    </tr>";
	$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Delete Existing Portal","form_delete_portal_chooser","");
	$s.="
      </td>
    </tr>";
	$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Modify Existing Portal","form_modify_portal_chooser","");
	$s.="
      </td>
    </tr>";
	$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Modify Subscribed Reports","form_modify_portal_subscriber_chooser","");
	$s.="
      </td>
    </tr>";
	$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	if($::GRI_FRONTEND->using_groups()==1) {
		$s.=link_to_str("stdlink","Change User/Group Access to Portal","form_modify_portal_users_chooser","");
	} else {
		$s.=link_to_str("stdlink","Change User Access to Portal","form_modify_portal_users_chooser","");
	}
	$s.="
      </td>
    </tr>";
	return $s;
}

1;
